package wps.mojo.utils;

import org.apache.commons.lang.StringUtils;

/**
 * @Author : <a href="mailto:Juanyong.zhang@carefirst.com">Cham
 *         Juanyong.zhang</a>
 * @Date : Apr 14, 2011
 */
public class StringHelper {
	public static String makePrettyIfItsPath(String org) {
		String[] parts = StringUtils.split(org, '\\');
		StringBuilder prettyPath = new StringBuilder();
		for (String part : parts) {
			if (StringUtils.isNotBlank(part)) {
				prettyPath.append(part);
				prettyPath.append("/");
			}
		}
		return StringUtils.removeEnd(prettyPath.toString(), "/");
	}
	
	
	public static void main(String[] args) {
		String path = "Program Files";
		
		System.out.println(StringHelper.makePrettyIfItsPath(path));
	}
}
